package com.plian.system.wrapper.qg.guarantee;

import com.plian.system.dto.qg.guarantee.PropertyGuaranteeRepaymentDTO;
import com.plian.system.entity.qg.guarantee.PropertyGuaranteeRepayment;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.qg.guarantee.PropertyGuaranteeRepaymentVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import static com.plian.system.wrapper.util.WrapperConstant.*;

/**
 * 企业担保还款包装类,返回视图层所需的字段
 *
 * @author jianglei
 * @since 2019-10-24
 */
@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class})
public interface PropertyGuaranteeRepaymentWrapper extends BaseWrapper<PropertyGuaranteeRepayment, PropertyGuaranteeRepaymentDTO, PropertyGuaranteeRepaymentVO> {

	/**
	 * Entity转VO
	 *
	 * @param entity /
	 * @return /
	 */
	@Override
	@Mappings(value = {
			@Mapping(source = "applyNameId", target = "applyName", qualifiedByName = ORG_ID_TO_NAME),
			@Mapping(source = "loanNatureId", target = "loanNatureName", qualifiedByName = DICT_CODE_LIST_TO_NAME)
	})
	PropertyGuaranteeRepaymentVO entityToVO(PropertyGuaranteeRepayment entity);

}
